<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<body>

<!--导航栏-->
<nav class="navbar navbar-default" th:fragment="Nav" style="margin-bottom: 0">
    <div class="container-fluid">

        <!--返回首页-->
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <!--
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            -->
            <a class="navbar-brand" th:href="@{/}">首页</a>
        </div>

        <!--搜索-->
        <form class="navbar-form navbar-left">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="输入……">
            </div>
            <button type="submit" class="btn btn-default">搜索</button>
        </form>


        <!--右边栏-->
        <ul class="nav navbar-nav navbar-right">
            <!--
            <li><a href="#">Link</a></li>
            -->
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                   aria-expanded="false">
                    <span th:if="${not #strings.isEmpty(user.name)}">
                        <span th:text="${user.name}" >
                        </span>
                        <span th:class="caret"></span>
                    </span>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="#">个人信息</a></li>

                    <!--这是分割线-->
                    <li role="separator" class="divider"></li>
                    <li><a th:href="@{/logout}">退出登录</a></li>
                </ul>
            </li>
        </ul>
    </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
</body>
</html>